<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>博客</title>
    <link href="<%=basePath%>bootstrap/css/blog-home.css"/>
    <link href="<%=basePath%>bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <script src="<%=basePath%>bootstrap/js/jquery-2.1.1.js"></script>
</head>
<c:if test="${null!=admin}">
<!-- Sidebar -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="<%=basePath %>admin?method=index">轻博客管理系统</a>
    </div>
    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse navbar-ex1-collapse">
        <ul class="nav navbar-nav side-nav">
            <li><a href="<%=basePath %>admin?method=index"><i class="glyphicon glyphicon-dashboard"></i> 控制面板</a></li>
            <li><a href="<%=basePath %>admin?method=useradmin"><i class="glyphicon glyphicon-cog"></i> 用户管理</a></li>
            <li><a href="<%=basePath %>admin?method=SysArticalAdmin"><i class="glyphicon glyphicon-cog"></i> 文章管理</a></li>
            <li class="active"><a href="<%=basePath %>admin?method=SysCategoryAdmin"><i class="glyphicon glyphicon-edit"></i> 分类管理</a></li>
        </ul>
        <ul class="nav navbar-nav navbar-right navbar-user">
            <li><a href="#"><i class="glyphicon glyphicon-user"></i>${admin.userName}</a></li>
            <li><a href="<%=basePath%>admin?method=logout"><i class="glyphicon glyphicon-off"></i> 登出</a></li>
        </ul>
    </div><!-- /.navbar-collapse -->
</nav>
<div style="position: absolute;top: 50px;left: 100px;width: 600px">
    <div class="row">
        <div class="col-md-12">
            <h1>博客系统 <small>基于Bootstrap、Jsp和Servlet技术构建</small></h1>
            <ol class="list-inline">
                <li><a href="<%=basePath%>admin/admin.jsp"><i class="glyphicon glyphicon-dashboard"></i> 控制面板</a></li>
                <li><a href="<%=basePath %>admin?method=SysCategoryAdmin"><i class="glyphicon glyphicon-cog"></i> 分类管理</a></li>
                <li class="active"><i class="glyphicon glyphicon-cog"></i> 编辑分类</li>
            </ol>
            <c:if test="${null!=scgExist}">
            <div class="row">
                <div class="col-md-12">
                    <div class="alert alert-warning">${scgExist}</div>
                </div>
            </div>
            <%
                    request.getSession().removeAttribute("scgExist");
            %>
            </c:if>
            <c:if test="${null!=scg}">
            <div class="row">
                <div class="col-md-6">
                    <form action="<%=basePath %>admin?method=SaveEditSysCategory&scgId=${scg.id}" method="post">
                        <label>分类名：</label>
                        <input name="scgName" class="form-control" type="text" value="${scg.categoryName}"/><br>
                        <input type="submit" class="btn btn-primary" value="保存">
                    </form>
                </div>
            </div>
            </c:if>
        </div><!-- /.col-md-12 -->
    </div><!-- /.row -->
</div><!-- /#page-wrapper -->
</c:if>
<c:if test="$null==admin">
<%-- 404 page --%>
<jsp:include page="404.jsp"></jsp:include>
</c:if>
<div><audio autoplay="autoplay" loop="true"><source src="music/1.mp3"></audio></div>
</body>
</html>